
public class Main {
    public static void main(String[] args) {
        int sum = 0;
        int i = 0;
        for(i = 1;i <= 100;i++) {
            if(i / 10 == 9) {
                sum++;
            }
            if(i % 10 == 9) {
                sum++;
            }
        }
        System.out.println("1-100内有："+sum+" 个9");
    }
    public static void main4(String[] args) {
        int year = 0;
        int x = 0;
        int num = 0;
        for(year = 1000;year <= 2000;year++) {
            if(year%400==0||(year%4==0&&year%100!=0)) {
                System.out.print(year+" ");
                x++;
                num++;
            }
            if(x >= 10){
                System.out.println();
                x -= 10;
            }
        }
        System.out.println();
        System.out.println("总共有："+num+"个闰年");
    }
    public static void main3(String[] args) {
        int x = 0;
        int i = 0;
        for(x = 1 ; x <= 100 ; x++) {
            int flag=0;
            for(i = 2;i < x;i++) {
                if(x % i == 0)
                {
                    flag = 1;
                    break;
                }
            }
            if(flag == 0)
                System.out.print(x+" ");
        }

    }
    //判断素数
    public static void main2(String[] args) {
        int a = 127;
        int flag = 0;
        int i = 0;
        for(i = 2; i < a ; i++) {
            if(a % i == 0) {
                flag=1;
                break;
            }
        }
        if(flag==1)
            System.out.println("不是素数");
        else
            System.out.println("是素数");
    }
    public static void main1(String[] args) {
        double x=2.0;
        int y=4;
        x/=++y;
        System.out.println(x);
    }
}